package com.jt.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * @author Cx
 * @stage JT Of Fourth stage
 * @creat 2020-12-01 14:57
 */
@Data
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
public class ImageVo {

    private Integer error; /* 0 表示正确 1 表示错误 */
    private String url; /* 图片浏览的网络地址[虚拟地址] */
    private Integer width; /* 宽度 */
    private Integer height; /* 高度 */

    public static ImageVo fail() {
        return new ImageVo(1, null, null, null);
    }

    public static ImageVo success(String url, Integer width, Integer height) {
        return new ImageVo(0, url, width, height);
    }

}
